-
Couldn't load subscription status.
- Fork 5.5k
17440 lightspeed #18396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
17440 lightspeed #18396
Conversation
…nt sources - Added actions for finding customers, invoices, orders, products, and shipments. - Introduced event sources for customer creation, updates, invoice updates, order creation, updates, and shipping events. - Updated app properties to include customer and order identifiers for better data retrieval. - Version bump to 0.1.0 and added dependencies for improved functionality.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
WalkthroughAdds a Lightspeed ECom C‑Series integration: expands the app with HTTP helpers, endpoint wrappers, and a paginate generator; adds paginated find/get actions; introduces a webhook-based common source and many instant event sources with test fixtures; updates package version and dependencies. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Action as Find Action
participant App as Lightspeed App
participant API as Lightspeed ECom API
User->>Action: Invoke action with filters
Action->>App: paginate(fn=listX, params, dataField)
loop For each page
App->>API: GET /{resource}.json?query
API-->>App: { dataField: [items], pagination }
App-->>Action: yield items
end
Action-->>User: return accumulated items + $summary
sequenceDiagram
autonumber
participant Src as Source (common base)
participant App as Lightspeed App
participant API as Lightspeed ECom API
participant Hook as HTTP endpoint
participant PD as Emitter
rect rgba(220,235,255,0.25)
note over Src,App: Activation
Src->>App: createHook({ itemGroup, itemAction, address })
App->>API: POST /hooks.json
API-->>App: { id, ... }
App-->>Src: webhook id
Src->>Src: store webhookId in DB
end
rect rgba(220,255,220,0.25)
note over API,Hook: Event delivery
API-->>Hook: POST webhook body
Hook->>Src: run({ body, headers })
Src->>Hook: http.respond(200)
Src->>PD: emit(body, meta)
end
rect rgba(255,235,200,0.25)
note over Src,App: Deactivation
Src->>Src: load webhookId from DB
Src->>App: deleteHook(webhookId)
App->>API: DELETE /hooks/{id}.json
API-->>App: 204
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60–90 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (3 warnings, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 14
🧹 Nitpick comments (43)
components/lightspeed_ecom_c_series/sources/product-deleted/test-event.mjs (1)
1-1: Empty sample payload — please provide a minimal, realistic shape or add rationaleAn empty object makes downstream examples / UI previews unhelpful. If Lightspeed sends no body on delete, add a comment stating that. Otherwise, include the minimal fields (e.g., product id).
Proposed minimal fixture (verify against actual webhook shape before committing):
-export default {} +export default { + product: { + id: 123 + } +}components/lightspeed_ecom_c_series/sources/invoice-updated/test-event.mjs (1)
1-52: Prefer HTTPS in sample linksAll “link” values use http://. Use https:// to avoid shipping insecure URLs in examples and quiet security scanners. Apply this across all test-event fixtures.
Example (repeat for all “link” fields in this file):
- "link":"http://api.shoplightspeed.com/en/orders/123.json" + "link":"https://api.shoplightspeed.com/en/orders/123.json"components/lightspeed_ecom_c_series/sources/order-updated/test-event.mjs (2)
10-11: Use reserved placeholders for IP/emailSwap the real-looking IP and non-reserved email domain for doc-safe placeholders.
- "remoteIp":"35.245.159.47", + "remoteIp":"203.0.113.10", ... - "email":"[email protected]", + "email":"[email protected]",Also applies to: 22-22
7-7: Order vs. shipment status consistencyOrder status is "completed_shipped" while shipmentStatus is "not_shipped". If intentional for edge-case coverage, add a brief comment; otherwise, align them.
Also applies to: 93-94
components/lightspeed_ecom_c_series/sources/customer-updated/test-event.mjs (2)
15-15: Use reserved example email domainReplace with example.com to avoid referencing a real domain.
- "email":"[email protected]", + "email":"[email protected]",
59-63: HTTPS links in sample dataStandardize “link” fields to https://.
Example:
- "link":"http:\/\/api.shoplightspeed.com\/en\/groups\/customers.json?customer=123" + "link":"https:\/\/api.shoplightspeed.com\/en\/groups\/customers.json?customer=123"Also applies to: 66-70, 101-106, 109-113
components/lightspeed_ecom_c_series/sources/new-product-created/test-event.mjs (1)
19-23: Switch test links to HTTPSSame HTTPS concern as other fixtures.
Representative change:
- "link":"http:\/\/api.shoplightspeed.com\/en\/brands\/123.json" + "link":"https:\/\/api.shoplightspeed.com\/en\/brands\/123.json"Also applies to: 26-30, 36-40, 43-47, 50-54, 58-62, 66-70, 73-77, 80-84
components/lightspeed_ecom_c_series/sources/new-order-created/test-event.mjs (2)
10-10: Use reserved placeholders for IP/email- "remoteIp":"35.245.159.47", + "remoteIp":"203.0.113.11", ... - "email":"[email protected]", + "email":"[email protected]",Also applies to: 22-22
615-619: HTTPS for linksUpdate sample links to https:// across this file.
- "link":"http:\/\/api.shoplightspeed.com\/en\/invoices\/123.json" + "link":"https:\/\/api.shoplightspeed.com\/en\/invoices\/123.json"Also applies to: 640-643, 678-681
components/lightspeed_ecom_c_series/sources/new-customer-created/test-event.mjs (2)
15-15: Use reserved example email domain- "email":"[email protected]", + "email":"[email protected]",
59-63: HTTPS links in sample dataSame as other fixtures.
- "link":"http:\/\/api.shoplightspeed.com\/en\/groups\/customers.json?customer=123" + "link":"https:\/\/api.shoplightspeed.com\/en\/groups\/customers.json?customer=123"Also applies to: 66-70, 101-106, 109-113
components/lightspeed_ecom_c_series/lightspeed_ecom_c_series.app.mjs (11)
145-149: Off‑by‑one in brands options pagination.Other option builders use
page + 1(Lightspeed pagination is 1‑based). Here it passespagedirectly, likely skipping page 1.- params: { - page, - }, + params: { + page: page + 1, + },
204-211: Base URL may be incorrect for common cluster values (eu1/us1).Official guidance maps clusters to fixed API hosts (eu1 → api.webshopapp.com, us1 → api.shoplightspeed.com). Building
https://api.${cluster}.comonly works ifclusteris alreadywebshopapporshoplightspeed. Add mapping or validate input.References: elastic.io Lightspeed eCom component docs show the mapping. (docs.elastic.io)
Suggested adjustment:
- _baseUrl() { - return `https://api.${this.$auth.cluster}.com/${this.$auth.lang}`; - }, + _baseUrl() { + const c = (this.$auth.cluster || "").toLowerCase(); + const host = + c === "eu1" || c === "eu" ? "api.webshopapp.com" : + c === "us1" || c === "us" || c === "noam" ? "api.shoplightspeed.com" : + c.includes(".") ? c : `api.${c}.com`; + return `https://${host}/${this.$auth.lang}`; + },If you intend
clusterto be the host fragment (e.g.,webshopapp/shoplightspeed), please document that in the auth UI.
18-23: Label building: guard against missing names.Customers without
firstname/lastnamerender labels with extra spaces. Minor, but easy to harden.- label: `${firstname} ${middlename && `${middlename} ` || ""}${lastname} ${email && `(${email})` || ""}`, + label: `${[firstname, middlename, lastname].filter(Boolean).join(" ")}${email ? ` (${email})` : ""}`,
37-42: Same label hardening suggestion for customer email options.- label: `${firstname} ${middlename && `${middlename} ` || ""}${lastname} ${value && `(${value})` || ""}`, + label: `${[firstname, middlename, lastname].filter(Boolean).join(" ")}${value ? ` (${value})` : ""}`,
56-61: Order options: stabilize when email missing.Minor parity with the customer label fix.
- label: `Order #${number} ${email && `(${email})`}`, + label: `Order #${number}${email ? ` (${email})` : ""}`,
75-81: Order ID options: same label nit.- label: `Order #${number} ${email && `(${email})`}`, + label: `Order #${number}${email ? ` (${email})` : ""}`,
94-99: Shipment number label nit.- label: `Shipment #${number} ${status && `(${status})`}`, + label: `Shipment #${number}${status ? ` (${status})` : ""}`,
113-118: Shipment ID label nit.- label: `Shipment #${number} ${status && `(${status})`}`, + label: `Shipment #${number}${status ? ` (${status})` : ""}`,
132-137: Invoice number label nit.- label: `Invoice #${number} ${status && `(${status})`}`, + label: `Invoice #${number}${status ? ` (${status})` : ""}`,
178-201: Date prop descriptions reference “products” only, but these props are reused for orders, invoices, shipments.Make the copy generic to avoid confusion in other actions.
- description: "Show products created after date. **Format: `YYYY-MM-DD HH:MM:SS`**", + description: "Show records created after date. **Format: `YYYY-MM-DD HH:MM:SS`**", @@ - description: "Show products created before date. **Format: `YYYY-MM-DD HH:MM:SS`**", + description: "Show records created before date. **Format: `YYYY-MM-DD HH:MM:SS`**", @@ - description: "Show products last updated after date. **Format: `YYYY-MM-DD HH:MM:SS`**", + description: "Show records last updated after date. **Format: `YYYY-MM-DD HH:MM:SS`**", @@ - description: "Show products last updated before date. **Format: `YYYY-MM-DD HH:MM:SS`**", + description: "Show records last updated before date. **Format: `YYYY-MM-DD HH:MM:SS`**",
10-11: Minor copy nits.
- “customerid” → “customer ID”
- “Retrieve all customers from a specific customer…” → “Retrieve customers by email.”
- description: "Retrieve all orders from a specific customer based on the customerid", + description: "Retrieve all orders from a specific customer based on the customer ID", @@ - description: "Retrieve all customers from a specific customer based on the customer email", + description: "Retrieve customers by email",Also applies to: 29-30
components/lightspeed_ecom_c_series/actions/get-order-products/get-order-products.mjs (1)
6-6: Tweak description grammar and link text.“Get an order products by ID” → “Get order products for an order ID.”
- description: "Get an order products by ID. [See the documentation](https://developers.lightspeedhq.com/ecom/endpoints/orderproduct/#get-all-order-products)", + description: "Get order products for an order ID. [See the documentation](https://developers.lightspeedhq.com/ecom/endpoints/orderproduct/#get-all-order-products)",components/lightspeed_ecom_c_series/actions/find-order/find-order.mjs (2)
5-7: Description doesn’t match behavior (filters vs “by ID”).This action searches with multiple filters, not strictly “by ID”. Reword to avoid confusion.
- description: "Find an order by ID. [See the documentation](https://developers.lightspeedhq.com/ecom/endpoints/order/#get-all-orders)", + description: "Find orders by filters. [See the documentation](https://developers.lightspeedhq.com/ecom/endpoints/order/#get-all-orders)",
62-76: Optional: add a max results cap to avoid unintentionally paging the entire dataset.Expose
limit(mapped topage_size) and/ormaxResultspassed topaginate.- const response = this.app.paginate({ + const response = this.app.paginate({ fn: this.app.listOrder, $, params: { customer: this.customerId, number: this.orderNumber, since_id: this.sinceId, created_at_min: this.createdAtMin, created_at_max: this.createdAtMax, updated_at_min: this.updatedAtMin, updated_at_max: this.updatedAtMax, }, dataField: "orders", + // maxResults: 500, // uncomment to cap results });components/lightspeed_ecom_c_series/actions/find-shipment/find-shipment.mjs (3)
5-7: Description doesn’t match behaviorThis action lists/filters shipments; it’s not “by ID.” Align name/description with actual filters.
- name: "Find Shipment", - description: "Find a shipment by ID. [See the documentation](https://developers.lightspeedhq.com/ecom/endpoints/shipment/#get-all-shipments)", + name: "Find Shipments", + description: "Find shipments using filters (customer, order, number, date range). See docs: Get all shipments.",
16-26: Property copy edits
- “customerid” → “customer ID”.
- Clarify order/shipment number behavior.
- description: "Retrieve all shipments from a specific customer based on the customerid", + description: "Retrieve shipments for a specific customer ID", ... - description: "Retrieve a shipment based on the order number", + description: "Retrieve shipments for an order number",
73-82: Avoid sending undefined filtersFilter out empty/undefined params to prevent noisy requests.
- params: { - customer: this.customerId, - order: this.orderNumber, - number: this.shipmentNumber, - since_id: this.sinceId, - created_at_min: this.createdAtMin, - created_at_max: this.createdAtMax, - updated_at_min: this.updatedAtMin, - updated_at_max: this.updatedAtMax, - }, + params: Object.fromEntries(Object.entries({ + customer: this.customerId, + order: this.orderNumber, + number: this.shipmentNumber, + since_id: this.sinceId, + created_at_min: this.createdAtMin, + created_at_max: this.createdAtMax, + updated_at_min: this.updatedAtMin, + updated_at_max: this.updatedAtMax, + }).filter(([, v]) => v != null && v !== "")),components/lightspeed_ecom_c_series/actions/find-customers/find-customers.mjs (3)
5-7: Description mismatchYou’re finding customers via filters (email, dates), not “by ID.” Align wording.
- description: "Find a customer by ID. [See the documentation](https://developers.lightspeedhq.com/ecom/endpoints/customer/#get-all-customers)", + description: "Find customers using filters (email, date range). See docs: Get all customers.",
16-18: Clarify prop phrasingCurrent text is awkward.
- description: "Retrieve all customers from a specific customer based on the customer email", + description: "Filter customers by email address",
54-67: Param sanitization (optional)Consider filtering out undefined/empty values for cleaner requests.
- params: { - email: this.customerEmail, - since_id: this.sinceId, - created_at_min: this.createdAtMin, - created_at_max: this.createdAtMax, - updated_at_min: this.updatedAtMin, - updated_at_max: this.updatedAtMax, - }, + params: Object.fromEntries(Object.entries({ + email: this.customerEmail, + since_id: this.sinceId, + created_at_min: this.createdAtMin, + created_at_max: this.createdAtMax, + updated_at_min: this.updatedAtMin, + updated_at_max: this.updatedAtMax, + }).filter(([, v]) => v != null && v !== "")),components/lightspeed_ecom_c_series/actions/find-product/find-product.mjs (2)
5-7: Fix grammar and scopeUse plural and remove “by ID” since this lists/filters.
- name: "Find Product", - description: "Find an product by ID. [See the documentation](https://developers.lightspeedhq.com/ecom/endpoints/product/#get-all-products)", + name: "Find Products", + description: "Find products using filters (brand, date range). See docs: Get all products.",
50-62: Param sanitization (optional)Keep requests clean by omitting undefined/empty values.
- params: { - brand: this.brandId, - since_id: this.sinceId, - created_at_min: this.createdAtMin, - created_at_max: this.createdAtMax, - updated_at_min: this.updatedAtMin, - updated_at_max: this.updatedAtMax, - }, + params: Object.fromEntries(Object.entries({ + brand: this.brandId, + since_id: this.sinceId, + created_at_min: this.createdAtMin, + created_at_max: this.createdAtMax, + updated_at_min: this.updatedAtMin, + updated_at_max: this.updatedAtMax, + }).filter(([, v]) => v != null && v !== "")),components/lightspeed_ecom_c_series/actions/find-invoice/find-invoice.mjs (3)
5-7: Description mismatchThis action lists/filters invoices; not “by ID.”
- description: "Find an invoice by ID. [See the documentation](https://developers.lightspeedhq.com/ecom/endpoints/invoice/#get-all-invoices)", + description: "Find invoices using filters (customer, order, number, date range). See docs: Get all invoices.",
16-26: Copy and semantics fixes
- “customerid” → “customer ID”.
- Order filter prop describes fetching an order; should reference invoices for an order number.
- description: "Retrieve all invoices from a specific customer based on the customerid", + description: "Retrieve invoices for a specific customer ID", ... - description: "Retrieve an order based on the order number", + description: "Retrieve invoices for an order number",
74-83: Omit undefined filters (optional)Mirror other comments: filter out empty values before calling.
- params: { - customer: this.customerId, - number: this.invoiceNumber, - order: this.orderNumber, - since_id: this.sinceId, - created_at_min: this.createdAtMin, - created_at_max: this.createdAtMax, - updated_at_min: this.updatedAtMin, - updated_at_max: this.updatedAtMax, - }, + params: Object.fromEntries(Object.entries({ + customer: this.customerId, + number: this.invoiceNumber, + order: this.orderNumber, + since_id: this.sinceId, + created_at_min: this.createdAtMin, + created_at_max: this.createdAtMax, + updated_at_min: this.updatedAtMin, + updated_at_max: this.updatedAtMax, + }).filter(([, v]) => v != null && v !== "")),components/lightspeed_ecom_c_series/sources/order-updated/order-updated.mjs (2)
6-8: Key prefix inconsistent with appOther modules use
lightspeed_ecom_c_series-.... Align for discoverability and to avoid collisions.- key: "indiefunnels-order-updated", + key: "lightspeed_ecom_c_series-order-updated",
8-9: Grammar fix“a order” → “an order”.
- description: "Emit new event when a order is updated.", + description: "Emit new event when an order is updated.",components/lightspeed_ecom_c_series/sources/product-deleted/product-deleted.mjs (2)
6-8: Key prefix inconsistent with appUse the same
lightspeed_ecom_c_series-prefix used elsewhere.- key: "indiefunnels-product-deleted", + key: "lightspeed_ecom_c_series-product-deleted",
20-26: Potential null deref with empty sample
generateMetaassumesbody.product.idanddeletedAt. The referenced test-event is empty in this PR; sample display may break.I can supply a minimal
test-event.mjs:export default { product: { id: 123, deletedAt: "2025-09-17T20:25:55+00:00", }, };components/lightspeed_ecom_c_series/sources/order-shipped/test-event.mjs (1)
7-7: Align sample payload with “shipped” semanticsThe order status shows completed_shipped, but shipmentStatus and shipments[].status are “not_shipped”. Align for clarity.
- "shipmentStatus":"not_shipped", + "shipmentStatus":"shipped",- "status":"not_shipped", + "status":"shipped",Also applies to: 339-339, 93-94
components/lightspeed_ecom_c_series/sources/new-customer-created/new-customer-created.mjs (1)
8-8: Grammar nit: “a customer”.Change “an customer” → “a customer”.
Apply this diff:
- description: "Emit new event when an customer is created.", + description: "Emit new event when a customer is created.",components/lightspeed_ecom_c_series/sources/common/base.mjs (1)
35-38: Guard deactivation when no webhookId is stored.Avoid calling
deleteHook(undefined)on first deploys or if state was cleared.Apply this diff:
async deactivate() { const webhookId = this._getWebhookId(); - await this.app.deleteHook(webhookId); + if (!webhookId) return; + await this.app.deleteHook(webhookId); },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (32)
components/lightspeed_ecom_c_series/actions/find-customers/find-customers.mjs(1 hunks)components/lightspeed_ecom_c_series/actions/find-invoice/find-invoice.mjs(1 hunks)components/lightspeed_ecom_c_series/actions/find-order/find-order.mjs(1 hunks)components/lightspeed_ecom_c_series/actions/find-product/find-product.mjs(1 hunks)components/lightspeed_ecom_c_series/actions/find-shipment/find-shipment.mjs(1 hunks)components/lightspeed_ecom_c_series/actions/get-order-products/get-order-products.mjs(1 hunks)components/lightspeed_ecom_c_series/actions/get-order/get-order.mjs(1 hunks)components/lightspeed_ecom_c_series/actions/get-product/get-product.mjs(1 hunks)components/lightspeed_ecom_c_series/actions/get-shipment/get-shipment.mjs(1 hunks)components/lightspeed_ecom_c_series/lightspeed_ecom_c_series.app.mjs(1 hunks)components/lightspeed_ecom_c_series/package.json(2 hunks)components/lightspeed_ecom_c_series/sources/common/base.mjs(1 hunks)components/lightspeed_ecom_c_series/sources/customer-updated/customer-updated.mjs(1 hunks)components/lightspeed_ecom_c_series/sources/customer-updated/test-event.mjs(1 hunks)components/lightspeed_ecom_c_series/sources/invoice-updated/invoice-updated.mjs(1 hunks)components/lightspeed_ecom_c_series/sources/invoice-updated/test-event.mjs(1 hunks)components/lightspeed_ecom_c_series/sources/new-customer-created/new-customer-created.mjs(1 hunks)components/lightspeed_ecom_c_series/sources/new-customer-created/test-event.mjs(1 hunks)components/lightspeed_ecom_c_series/sources/new-invoice-created/new-invoice-created.mjs(1 hunks)components/lightspeed_ecom_c_series/sources/new-invoice-created/test-event.mjs(1 hunks)components/lightspeed_ecom_c_series/sources/new-order-created/new-order-created.mjs(1 hunks)components/lightspeed_ecom_c_series/sources/new-order-created/test-event.mjs(1 hunks)components/lightspeed_ecom_c_series/sources/new-product-created/new-product-created.mjs(1 hunks)components/lightspeed_ecom_c_series/sources/new-product-created/test-event.mjs(1 hunks)components/lightspeed_ecom_c_series/sources/order-shipped/order-shipped.mjs(1 hunks)components/lightspeed_ecom_c_series/sources/order-shipped/test-event.mjs(1 hunks)components/lightspeed_ecom_c_series/sources/order-updated/order-updated.mjs(1 hunks)components/lightspeed_ecom_c_series/sources/order-updated/test-event.mjs(1 hunks)components/lightspeed_ecom_c_series/sources/product-deleted/product-deleted.mjs(1 hunks)components/lightspeed_ecom_c_series/sources/product-deleted/test-event.mjs(1 hunks)components/lightspeed_ecom_c_series/sources/product-updated/product-updated.mjs(1 hunks)components/lightspeed_ecom_c_series/sources/product-updated/test-event.mjs(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2024-12-12T19:23:09.039Z
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14935
File: components/sailpoint/package.json:15-18
Timestamp: 2024-12-12T19:23:09.039Z
Learning: When developing Pipedream components, do not add built-in Node.js modules like `fs` to `package.json` dependencies, as they are native modules provided by the Node.js runtime.
Applied to files:
components/lightspeed_ecom_c_series/package.json
📚 Learning: 2024-10-08T15:33:38.240Z
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-10-08T15:33:38.240Z
Learning: The `common-webhook-methods.mjs` object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like `generateWebhookMeta` and `getEventType` to enforce implementation in subclasses.
Applied to files:
components/lightspeed_ecom_c_series/sources/common/base.mjs
🧬 Code graph analysis (10)
components/lightspeed_ecom_c_series/actions/find-shipment/find-shipment.mjs (6)
components/lightspeed_ecom_c_series/actions/find-customers/find-customers.mjs (1)
response(55-67)components/lightspeed_ecom_c_series/actions/find-invoice/find-invoice.mjs (1)
response(71-85)components/lightspeed_ecom_c_series/actions/find-order/find-order.mjs (1)
response(63-76)components/lightspeed_ecom_c_series/actions/find-product/find-product.mjs (1)
response(50-62)components/lightspeed_ecom_c_series/actions/get-order-products/get-order-products.mjs (1)
response(19-24)components/lightspeed_ecom_c_series/lightspeed_ecom_c_series.app.mjs (1)
response(312-315)
components/lightspeed_ecom_c_series/actions/find-customers/find-customers.mjs (6)
components/lightspeed_ecom_c_series/actions/find-invoice/find-invoice.mjs (1)
response(71-85)components/lightspeed_ecom_c_series/actions/find-order/find-order.mjs (1)
response(63-76)components/lightspeed_ecom_c_series/actions/find-product/find-product.mjs (1)
response(50-62)components/lightspeed_ecom_c_series/actions/find-shipment/find-shipment.mjs (1)
response(70-84)components/lightspeed_ecom_c_series/actions/get-order-products/get-order-products.mjs (1)
response(19-24)components/lightspeed_ecom_c_series/lightspeed_ecom_c_series.app.mjs (1)
response(312-315)
components/lightspeed_ecom_c_series/actions/get-product/get-product.mjs (3)
components/lightspeed_ecom_c_series/actions/get-order/get-order.mjs (1)
response(19-22)components/lightspeed_ecom_c_series/actions/get-shipment/get-shipment.mjs (1)
response(19-22)components/lightspeed_ecom_c_series/lightspeed_ecom_c_series.app.mjs (1)
response(312-315)
components/lightspeed_ecom_c_series/actions/get-shipment/get-shipment.mjs (3)
components/lightspeed_ecom_c_series/actions/get-order/get-order.mjs (1)
response(19-22)components/lightspeed_ecom_c_series/actions/get-product/get-product.mjs (1)
response(19-22)components/lightspeed_ecom_c_series/lightspeed_ecom_c_series.app.mjs (1)
response(312-315)
components/lightspeed_ecom_c_series/actions/get-order-products/get-order-products.mjs (4)
components/lightspeed_ecom_c_series/actions/find-customers/find-customers.mjs (1)
response(55-67)components/lightspeed_ecom_c_series/actions/find-product/find-product.mjs (2)
response(50-62)products(64-64)components/lightspeed_ecom_c_series/actions/get-order/get-order.mjs (1)
response(19-22)components/lightspeed_ecom_c_series/lightspeed_ecom_c_series.app.mjs (1)
response(312-315)
components/lightspeed_ecom_c_series/actions/find-invoice/find-invoice.mjs (5)
components/lightspeed_ecom_c_series/actions/find-customers/find-customers.mjs (1)
response(55-67)components/lightspeed_ecom_c_series/actions/find-order/find-order.mjs (1)
response(63-76)components/lightspeed_ecom_c_series/actions/find-product/find-product.mjs (1)
response(50-62)components/lightspeed_ecom_c_series/actions/find-shipment/find-shipment.mjs (1)
response(70-84)components/lightspeed_ecom_c_series/lightspeed_ecom_c_series.app.mjs (1)
response(312-315)
components/lightspeed_ecom_c_series/actions/find-order/find-order.mjs (6)
components/lightspeed_ecom_c_series/actions/find-customers/find-customers.mjs (1)
response(55-67)components/lightspeed_ecom_c_series/actions/find-invoice/find-invoice.mjs (1)
response(71-85)components/lightspeed_ecom_c_series/actions/find-product/find-product.mjs (1)
response(50-62)components/lightspeed_ecom_c_series/actions/find-shipment/find-shipment.mjs (1)
response(70-84)components/lightspeed_ecom_c_series/actions/get-order-products/get-order-products.mjs (1)
response(19-24)components/lightspeed_ecom_c_series/lightspeed_ecom_c_series.app.mjs (1)
response(312-315)
components/lightspeed_ecom_c_series/actions/find-product/find-product.mjs (6)
components/lightspeed_ecom_c_series/actions/find-customers/find-customers.mjs (1)
response(55-67)components/lightspeed_ecom_c_series/actions/find-invoice/find-invoice.mjs (1)
response(71-85)components/lightspeed_ecom_c_series/actions/find-order/find-order.mjs (1)
response(63-76)components/lightspeed_ecom_c_series/actions/find-shipment/find-shipment.mjs (1)
response(70-84)components/lightspeed_ecom_c_series/actions/get-order-products/get-order-products.mjs (2)
response(19-24)products(26-26)components/lightspeed_ecom_c_series/lightspeed_ecom_c_series.app.mjs (1)
response(312-315)
components/lightspeed_ecom_c_series/actions/get-order/get-order.mjs (4)
components/lightspeed_ecom_c_series/actions/get-order-products/get-order-products.mjs (1)
response(19-24)components/lightspeed_ecom_c_series/actions/get-product/get-product.mjs (1)
response(19-22)components/lightspeed_ecom_c_series/actions/get-shipment/get-shipment.mjs (1)
response(19-22)components/lightspeed_ecom_c_series/lightspeed_ecom_c_series.app.mjs (1)
response(312-315)
components/lightspeed_ecom_c_series/lightspeed_ecom_c_series.app.mjs (10)
components/lightspeed_ecom_c_series/actions/find-customers/find-customers.mjs (2)
customers(69-69)response(55-67)components/lightspeed_ecom_c_series/actions/find-order/find-order.mjs (2)
orders(78-78)response(63-76)components/lightspeed_ecom_c_series/actions/find-shipment/find-shipment.mjs (2)
shipments(86-86)response(70-84)components/lightspeed_ecom_c_series/actions/find-invoice/find-invoice.mjs (2)
invoices(87-87)response(71-85)components/lightspeed_ecom_c_series/actions/find-product/find-product.mjs (2)
products(64-64)response(50-62)components/lightspeed_ecom_c_series/actions/get-order-products/get-order-products.mjs (2)
products(26-26)response(19-24)components/lightspeed_ecom_c_series/actions/get-order/get-order.mjs (1)
response(19-22)components/lightspeed_ecom_c_series/actions/get-product/get-product.mjs (1)
response(19-22)components/lightspeed_ecom_c_series/actions/get-shipment/get-shipment.mjs (1)
response(19-22)components/lightspeed_ecom_c_series/sources/common/base.mjs (1)
response(22-32)
🔇 Additional comments (24)
components/lightspeed_ecom_c_series/package.json (2)
3-3: Semver bump looks appropriateBumping to 0.1.0 for new sources/actions reads right. LGTM.
15-17: Confirm minimal required @pipedream/platform version and align across repoScan shows inconsistent versions across components (range: ^0.9.0 → ^3.1.0; also bare 1.x/2.x/3.x entries and one "null" — likely a malformed package.json).
- Determine the minimum @pipedream/platform required by this component; bump the floor if it uses APIs newer than the chosen baseline.
- Pick a repo-wide target (e.g., standardize to ^3.1.0 if needed) and update all components/**/package.json to match, then run CI/tests.
- Investigate and fix the package.json(s) that produced "null" in the scan.
components/lightspeed_ecom_c_series/actions/get-product/get-product.mjs (1)
3-26: LGTM.Action shape matches the app helper and returns the API payload with a concise summary. No blockers.
components/lightspeed_ecom_c_series/actions/get-order-products/get-order-products.mjs (2)
31-33: Summary string has an extra “order”.Reads “Successfully retrieved order 5 product(s)…”. Drop the first “order”.
[raise_nitpick_refactor]
- $.export("$summary", `Successfully retrieved order ${products.length} product${products.length === 1 + $.export("$summary", `Successfully retrieved ${products.length} product${products.length === 1 ? "" - : "s"} for order with ID: ${this.orderId}`); + : "s"} for order ID: ${this.orderId}`);
19-24: ConfirmdataFieldname returned by/orders/{id}/products.json.Some implementations return
orderproducts(lowercase) instead oforderProducts. If the field name doesn’t match, pagination will yield nothing.Run this quick grep to see what field name we use elsewhere and avoid a mismatch:
If the API returns
orderproducts, updatedataFieldaccordingly.components/lightspeed_ecom_c_series/actions/find-order/find-order.mjs (1)
16-17: Copy nit: “customerid”.[raise_nitpick_refactor]
- description: "Retrieve all orders from a specific customer based on the customerid", + description: "Retrieve all orders from a specific customer based on the customer ID",components/lightspeed_ecom_c_series/actions/get-order/get-order.mjs (1)
3-26: LGTM.Straightforward wrapper over
getOrderwith a clear summary.components/lightspeed_ecom_c_series/actions/find-shipment/find-shipment.mjs (2)
91-94: Good UX summaryPluralization handled correctly.
69-84: Verify whether theorderfilter expects the internal order ID (not the visible order number)
You map orderNumber →orderin components/lightspeed_ecom_c_series/actions/find-shipment/find-shipment.mjs; confirm the C‑Series GET /shipments.jsonorderquery parameter expects the internal order ID (document ID/GUID) rather than the human‑readable order number — if it expects the ID, send the ID instead (or use the documented parameter name); if it expects the order number, no change needed.components/lightspeed_ecom_c_series/actions/find-customers/find-customers.mjs (1)
74-77: Nice summaryPluralization is correct.
components/lightspeed_ecom_c_series/actions/get-shipment/get-shipment.mjs (1)
18-26: LGTMDirect pass-through to app client with a clear summary. Matches get‑order/get‑product patterns.
components/lightspeed_ecom_c_series/actions/find-product/find-product.mjs (1)
69-72: Good summaryPluralization handled.
components/lightspeed_ecom_c_series/actions/find-invoice/find-invoice.mjs (2)
92-95: Nice summaryPluralization handled.
70-85: Confirm whetherorderquery parameter requires an order ID (not order number)No official Lightspeed C‑Series docs found for GET /invoices.json; unclear if
orderexpects an order ID or an order number — mapping orderNumber →ordermay be incorrect.File: components/lightspeed_ecom_c_series/actions/find-invoice/find-invoice.mjs (lines 70–85)
Verify by testing GET /invoices.json against a store (compare queries using order number vs order ID) or confirm with Lightspeed support; if
orderrequires an ID, send the order ID (or use the correct parameter) instead of the order number.components/lightspeed_ecom_c_series/sources/order-updated/order-updated.mjs (1)
20-26: Meta generation looks goodId/summary/timestamp are sensible. Assumes
body.order.updatedAtexists.Please confirm the webhook payload contains
order.updatedAtin UTC ISO 8601.components/lightspeed_ecom_c_series/sources/product-updated/test-event.mjs (1)
1-90: Fixture is rich and representativeGood coverage of nested product relations; useful for UI/testing.
Confirm these fields mirror an actual eCom product payload (C‑Series), especially
visibility,brand.resource, andvariants.resourceshapes.components/lightspeed_ecom_c_series/sources/new-order-created/new-order-created.mjs (1)
20-25: LGTM on meta fieldsUsing order.id and createdAt for created events is appropriate.
components/lightspeed_ecom_c_series/sources/new-product-created/new-product-created.mjs (1)
4-29: Pattern matches base correctlyGroup/action/meta look good; created events safely dedupe on product.id.
components/lightspeed_ecom_c_series/sources/new-invoice-created/new-invoice-created.mjs (1)
4-29: Solid created-event sourceMeta/id/ts mapping is consistent with created semantics.
components/lightspeed_ecom_c_series/sources/new-invoice-created/test-event.mjs (1)
1-52: Fixture looks goodStructure matches source expectations; timestamps are ISO8601 with offset.
components/lightspeed_ecom_c_series/sources/new-customer-created/new-customer-created.mjs (2)
4-12: Good use of common base and source metadata.Structure, spread of common, and dedupe mode are consistent with other Pipedream sources.
20-26: Use snake_case "created_at" (not createdAt) in generateMetaLightspeed eCom C‑Series customer payloads use "id" and "created_at" (snake_case). Update components/lightspeed_ecom_c_series/sources/new-customer-created/new-customer-created.mjs (lines 20–26) to read body.customer.created_at for ts parsing instead of body.customer.createdAt.
⛔ Skipped due to learnings
Learnt from: GTFalcao PR: PipedreamHQ/pipedream#17538 File: components/aircall/sources/new-sms/new-sms.mjs:19-25 Timestamp: 2025-07-09T18:07:12.426Z Learning: In Aircall API webhook payloads, the `created_at` field is returned as an ISO 8601 string format (e.g., "2020-02-18T20:52:22.000Z"), not as milliseconds since epoch. For Pipedream components, this needs to be converted to milliseconds using `Date.parse()` before assigning to the `ts` field in `generateMeta()`.components/lightspeed_ecom_c_series/sources/common/base.mjs (1)
1-11: Base scaffold looks solid.Props wiring for
app,db, and custom HTTP interface aligns with Pipedream patterns.components/lightspeed_ecom_c_series/sources/product-updated/product-updated.mjs (1)
4-12: Structure LGTM.Extends the common base correctly; item group/action match the event semantics.
components/lightspeed_ecom_c_series/sources/customer-updated/customer-updated.mjs
Outdated
Show resolved
Hide resolved
components/lightspeed_ecom_c_series/sources/customer-updated/customer-updated.mjs
Show resolved
Hide resolved
components/lightspeed_ecom_c_series/sources/new-order-created/test-event.mjs
Show resolved
Hide resolved
components/lightspeed_ecom_c_series/sources/order-shipped/order-shipped.mjs
Outdated
Show resolved
Hide resolved
components/lightspeed_ecom_c_series/sources/order-shipped/order-shipped.mjs
Show resolved
Hide resolved
components/lightspeed_ecom_c_series/sources/order-updated/test-event.mjs
Show resolved
Hide resolved
components/lightspeed_ecom_c_series/sources/product-updated/product-updated.mjs
Show resolved
Hide resolved
…nd metadata generation - Updated webhook address to include '/webhook' for proper endpoint configuration. - Modified `run` method to accept headers for improved metadata generation. - Simplified summary generation in multiple sources to remove unnecessary method calls. - Adjusted `generateMeta` in `product-deleted` to utilize headers for product ID and current timestamp.
…nsistency
- Updated source keys to follow the new naming convention: "lightspeed_ecom_c_series-{event}".
- Corrected minor grammatical errors in descriptions across multiple sources.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
♻️ Duplicate comments (2)
components/lightspeed_ecom_c_series/sources/customer-updated/customer-updated.mjs (1)
20-26: Event loss: dedupe strategy still collapses multiple updates.With
dedupe: "unique"on line 11, using onlybody.customer.id(line 22) as the meta ID causes subsequent updates to the same customer to be dropped. The previous review comment provided a comprehensive fix including optional chaining, timestamp-based unique IDs, and safe fallback for invalid dates—this feedback remains unaddressed.Please apply the previously suggested diff (or a similar approach) to ensure each customer update generates a distinct event.
components/lightspeed_ecom_c_series/sources/new-customer-created/new-customer-created.mjs (1)
20-26: Add defensive null checks to prevent runtime crashes.The
generateMetamethod accesses nested properties (body.customer.id,body.customer.createdAt) without checking if they exist. If the webhook payload is malformed or missing expected fields, this will throw at runtime and crash the source.Apply this diff to add optional chaining and fallbacks:
generateMeta(body) { + const id = body?.customer?.id; + const ts = Date.parse(body?.customer?.createdAt) || Date.now(); return { - id: body.customer.id, - summary: `Customer with ID ${body.customer.id} created`, - ts: Date.parse(body.customer.createdAt), + id, + summary: `Customer with ID ${id} created`, + ts, }; },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (11)
components/lightspeed_ecom_c_series/sources/common/base.mjs(1 hunks)components/lightspeed_ecom_c_series/sources/customer-updated/customer-updated.mjs(1 hunks)components/lightspeed_ecom_c_series/sources/invoice-updated/invoice-updated.mjs(1 hunks)components/lightspeed_ecom_c_series/sources/new-customer-created/new-customer-created.mjs(1 hunks)components/lightspeed_ecom_c_series/sources/new-invoice-created/new-invoice-created.mjs(1 hunks)components/lightspeed_ecom_c_series/sources/new-order-created/new-order-created.mjs(1 hunks)components/lightspeed_ecom_c_series/sources/new-product-created/new-product-created.mjs(1 hunks)components/lightspeed_ecom_c_series/sources/order-shipped/order-shipped.mjs(1 hunks)components/lightspeed_ecom_c_series/sources/order-updated/order-updated.mjs(1 hunks)components/lightspeed_ecom_c_series/sources/product-deleted/product-deleted.mjs(1 hunks)components/lightspeed_ecom_c_series/sources/product-updated/product-updated.mjs(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (7)
- components/lightspeed_ecom_c_series/sources/invoice-updated/invoice-updated.mjs
- components/lightspeed_ecom_c_series/sources/order-updated/order-updated.mjs
- components/lightspeed_ecom_c_series/sources/new-product-created/new-product-created.mjs
- components/lightspeed_ecom_c_series/sources/common/base.mjs
- components/lightspeed_ecom_c_series/sources/order-shipped/order-shipped.mjs
- components/lightspeed_ecom_c_series/sources/product-updated/product-updated.mjs
- components/lightspeed_ecom_c_series/sources/new-order-created/new-order-created.mjs
🔇 Additional comments (8)
components/lightspeed_ecom_c_series/sources/customer-updated/customer-updated.mjs (2)
1-19: LGTM overall—good structure and metadata!The imports, metadata properties, helper methods (
getItemGroup,getItemAction), andsampleEmitattachment follow the established pattern for instant sources in this integration.Also applies to: 28-28
8-8: Grammar issue resolved.The description now correctly reads "a customer" instead of "an customer." Thanks for addressing the previous feedback!
components/lightspeed_ecom_c_series/sources/new-invoice-created/new-invoice-created.mjs (2)
1-2: LGTM!The imports correctly reference the common base and test event fixture, following the standard pattern for instant event sources.
4-11: LGTM!The source configuration is correct with appropriate dedupe strategy for webhook-based events.
components/lightspeed_ecom_c_series/sources/product-deleted/product-deleted.mjs (4)
1-2: LGTM!The imports follow the established pattern for instant event sources in this integration.
4-11: LGTM!The source configuration is well-structured and follows the established pattern. The
dedupe: "unique"strategy is appropriate for preventing duplicate product deletion events.
14-19: LGTM!The getter methods correctly identify the webhook event type as
products.deleted.
28-28: LGTM!The
sampleEmitassignment follows the established pattern for providing test fixtures.
components/lightspeed_ecom_c_series/sources/new-customer-created/new-customer-created.mjs
Outdated
Show resolved
Hide resolved
components/lightspeed_ecom_c_series/sources/new-invoice-created/new-invoice-created.mjs
Show resolved
Hide resolved
components/lightspeed_ecom_c_series/sources/product-deleted/product-deleted.mjs
Show resolved
Hide resolved
- Added 'annotations' property to multiple action components including find-customers, find-invoice, find-order, find-product, find-shipment, get-order, get-order-products, get-product, and get-shipment. - Each annotation includes 'destructiveHint', 'openWorldHint', and 'readOnlyHint' for better clarity on action behavior.
Resolves #17440
Summary by CodeRabbit
New Features
Chores